﻿SeadragonJSUtils = function() {
    /// <summary>STATIC CLASS</summary>
}

SeadragonJSUtils.getBrowser = function() {
    /// <summary>Returns the user's browser. This method is resistant to user-agent spoofing.</summary>
    /// <returns type="Object"></returns>
}

SeadragonJSUtils.getBrowserVersion = function() {
    /// <summary>Returns the version of the user's browser, or 0 if the browser is unknown. The version is up to one decimal place and does not include any letters (e.g. 'a' for an alpha release).</summary>
    /// <returns type="Number"></returns>
}

SeadragonJSUtils.getElement = function(elmt) {
    /// <summary>Convenience method that returns the HTML Element object for the given argument, which can be the element itself or the element's id.</summary>
    /// <param name="elmt"></param>
    /// <returns type="Object"></returns>
}

SeadragonJSUtils.getElementPosition = function(elmt) {
    /// <summary>Returns the user's browser. This method is resistant to user-agent spoofing.</summary>
    /// <param name="elmt"></param>
    /// <returns type="Object"></returns>
}

SeadragonJSUtils.getElementSize = function(elmt) {
    /// <summary>Returns the size of the given element.</summary>
    /// <param name="elmt"></param>
    /// <returns type="SeadragonJSPoint"></returns>
}

SeadragonJSUtils.getElementStyle = function(elmt) {
    /// <summary>Returns the computed style of the given element. This style object exposes the same Javascript properties as the inline elmt.style object, e.g. "textAlign" for the CSS "text-align" property.</summary>
    /// <param name="elmt"></param>
    /// <returns type="Object"></returns>
}

SeadragonJSUtils.getEvent = function(event) {
    /// <summary>Convenience method that returns the HTML Event object for the given argument, which can be the event itself or undefined, since IE doesn't pass the event object to event handlers.</summary>
    /// <param name="event"></param>
    /// <returns type="Object"></returns>
}

SeadragonJSUtils.getMousePosition = function(event) {
    /// <summary>Returns the position of the mouse during the given event, relative to the document.</summary>
    /// <param name="event"></param>
    /// <returns type="SeadragonJSPoint"></returns>
}

SeadragonJSUtils.getMouseScroll = function(event) {
    /// <summary>Returns the amount the mouse wheel was scrolled during the given event, normalized between -1 and 1.</summary>
    /// <param name="event"></param>
    /// <returns type="Number"></returns>
}

SeadragonJSUtils.getPageScroll = function(event) {
    /// <summary>Returns the amount that the page is currently scrolled.</summary>
    /// <param name="event"></param>
    /// <returns type="Number"></returns>
}

SeadragonJSUtils.getWindowSize = function(event) {
    /// <summary>Returns the current size of the browser's viewport.</summary>
    /// <param name="event"></param>
    /// <returns type="SeadragonJSPoint"></returns>
}

SeadragonJSUtils.imageFormatSupported = function(ext) {
    /// <summary>Returns true if the browser can natively display images of the given format.</summary>
    /// <param name="ext">Extension to check for support</param>
    /// <returns type="Boolean"></returns>
}

SeadragonJSUtils.makeCenteredNode = function(elmt) {
    /// <summary>Returns an HTML element that contains the given HTML node (which can be a text node). The node will be centered both vertically and horizontally when the returned element is placed inside any container. This method ensures vertical centering in IE, whereas the W3C CSS table-cell technique does not.</summary>
    /// <param name="elmt"></param>
    /// <returns type="Object"></returns>
}

SeadragonJSUtils.makeNeutralElement = function(tagName) {
    /// <summary>Creates and returns an HTML element for the given tag name. This element has inline style to neutralize any inherited style.</summary>
    /// <param name="tagName"></param>
    /// <returns type="Object"></returns>
}

SeadragonJSUtils.makeTransparentImage = function(src) {
    /// <summary>Returns an HTML element for the image at the given URL. This element supports alpha channels used by the PNG format safely. This method should be called to ensure transparency in IE6.</summary>
    /// <param name="src"></param>
    /// <returns type="Object"></returns>
}

SeadragonJSUtils.setElementOpacity = function(elmt, opacity, usesAlpha) {
    /// <summary>Sets the opacity of the given element to the given amount, which should be between 0 and 1. Preserves non-alpha filters (e.g. AlphaImageLoader) in IE. If usesAlpha is true, adjusts for browsers which do not handle multi-bit alpha channels properly. If the element is a PNG image that uses an alpha channel, or if the element contains such PNG images, usesAlpha should be true. This is not required for GIF images, which use 1-bit alpha channels.</summary>
    /// <param name="elmt"></param>
    /// <param name="opacity"></param>
    /// <param name="usesAlpha">If usesAlpha is true, adjusts for browsers which do not handle multi-bit alpha channels properly. If the element is a PNG image that uses an alpha channel, or if the element contains such PNG images, usesAlpha should be true. This is not required for GIF images, which use 1-bit alpha channels.</param>
}

SeadragonJSUtils.addEvent = function(elmt, eventName, handler, useCapture) {
    /// <summary>Attaches the given handler function to the given element, for the event with the given name (without the "on" prefix). If useCapture is true and the browser is IE, the element begins capturing all mouse events. If useCapture is true and the browser is not IE, the handler is registered for the event's capture phase instead of the event's bubble phase.</summary>
    /// <param name="elmt"></param>
    /// <param name="eventName"></param>
    /// <param name="handler"></param>
    /// <param name="useCapture">IE's capture model is entirely different from the W3C capture model. Be sure to understand their differences before specifying useCapture to true in cross-browser scripts. As general rules of thumb, only specify it for mouse events, and remove the handlers on or before "mouseup" events. Seadragon.MouseTracker is a good abstraction for this and should be powerful enough for most useCapture scenarios.</param>
}

SeadragonJSUtils.removeEvent = function(elmt, eventName, handler, useCapture) {
    /// <summary>Detaches the given handler function from the given element, for the event with the given name (without the "on" prefix). If useCapture is true and the browser is IE, the element releases capture of mouse events. If useCapture is true and the browser is not IE, the handler for the event's capture phase is removed, instead of for the event's bubble phase.</summary>
    /// <param name="elmt"></param>
    /// <param name="eventName"></param>
    /// <param name="handler"></param>
    /// <param name="useCapture">IE's capture model is entirely different from the W3C capture model. Be sure to understand their differences before specifying useCapture to true in cross-browser scripts. As general rules of thumb, only specify it for mouse events, and remove the handlers on or before "mouseup" events. Seadragon.MouseTracker is a good abstraction for this and should be powerful enough for most useCapture scenarios.</param>
}

SeadragonJSUtils.cancelEvent = function(event) {
    /// <summary>Cancels the given event so that its default action will not be performed by the browser. Note that the event will still continue to propagate up or down the DOM tree unless stopEvent() is called.</summary>
    /// <param name="event"></param>
    /// <returns type="Boolean"></returns>
}

SeadragonJSUtils.stopEvent = function(event) {
    /// <summary>Stops the given event so that it no longer propagates up or down the DOM tree. Note that its default action will still be performed by the browser unless cancelEvent() is called.</summary>
    /// <param name="event"></param>
    /// <returns type="Boolean"></returns>
}

SeadragonJSUtils.createCallback = function(object, func, parameters) {
    /// <summary>Returns a function that calls the given function with the given object as the execution scope. That is, the Javascript keyword this will refer to the given object inside the given function.</summary>
    /// <param name="object"></param>
    /// <param name="func">Function to associate</param>
    /// <param name="parameters" optional="true">Any additional arguments passed to this function will also be passed to the given function, in addition to arguments passed to the returned function. The additional arguments are concatenated to the previous arguments. For example, Seadragon.Utils.createCallback(null, func, 1, 2, 3)(4, 5) is equivalent to func(1, 2, 3, 4, 5).</param>
    /// <returns type="Function"></returns>
}

SeadragonJSUtils.getUrlParameter = function(key) {
    /// <summary>Returns the value for the given key in the URL search string, or null if the URL search string includes no such parameter.</summary>
    /// <param name="key"></param>
    /// <returns type="String"></returns>
}

SeadragonJSUtils.makeAjaxRequest = function(url, callback) {
    /// <summary>Makes an AJAX request to the given URL. If a callback function is given, the request is asynchronous, and the XMLHttpRequest object is passed as the sole parameter to the callback upon completion (readyState of 4). Otherwise, the XML is loaded synchronously and the XMLHttpRequest object is returned by this method. If there is a security error or any other error in simply creating the request, null is passed or returned. Otherwise, the status property of the XMLHttpRequest object can be used to determine success (status of 200 usually means successful).</summary>
    /// <param name="url"></param>
    /// <param name="callback" optional="true"></param>
    /// <returns type="XMLHttpRequest"></returns>
}

SeadragonJSUtils.parseXml = function(string) {
    /// <summary>Parses the given string into an XML document and returns the Document object. This method is synchronous.</summary>
    /// <param name="string"></param>
    /// <returns type="XML Document"></returns>
}

